#define _CRT_SECURE_NO_WARNINGS 1
#include <cstdio>
#include <iostream>
#include <string.h> 
using namespace std;

int parity_check(const char* msg, const int msg_length) 
{
    if (msg_length < 0) 
        return 0;           

    if (msg_length > 0 && msg == NULL)
        return 0; 

    int count = 0;
    for (int i = 0; i < msg_length; i++) 
    {
        if (msg[i] != '0')
            count++; 
    }
    return (count % 2 == 0) ? 1 : 0;
}

int main() 
{
    char s[20] = { 0 };
    cin >> s;
    int len = strlen(s);
    const char* msg = (const char*)s;

    printf("%d\n", parity_check(msg, strlen(msg)));
    return 0;
}